package com.xbts.screen.monitor.domain;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.annotation.TableName;
import com.xbts.common.core.annotation.Excel;
import com.xbts.common.core.web.domain.BaseIdEntity ;
import com.xbts.common.core.utils.StringUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * 监控设备连接配置对象 we_monitor_connect_config
 * 
 * @author xbts
 * @date 2024-09-05
 */
@Data
@ApiModel(value = "WeMonitorConnectConfig", description = "监控设备连接配置对象")
@TableName("we_monitor_connect_config")
public class WeMonitorConnectConfig extends BaseIdEntity {
    private static final long serialVersionUID = 1L;

    /** 主机地址 */
    @Excel(name = "主机地址")
    @ApiModelProperty("主机地址")
    private String host;

    /** 用户名 */
    @Excel(name = "用户名")
    @ApiModelProperty("用户名")
    private String username;

    /** 密码 */
    @Excel(name = "密码")
    @ApiModelProperty("密码")
    private String password;

    /** 客户端id */
    @Excel(name = "客户端id")
    @ApiModelProperty("客户端id")
    private String clientId;

    /** 客户端秘钥 */
    @Excel(name = "客户端秘钥")
    @ApiModelProperty("客户端秘钥")
    private String clientSecret;

    /** https端口 */
    @Excel(name = "https端口")
    @ApiModelProperty("https端口")
    private String https;

    /** http端口 */
    @Excel(name = "http端口")
    @ApiModelProperty("http端口")
    private String http;

    /** http请求协议 是否开启http调试模式 */
    @Excel(name = "http请求协议 是否开启http调试模式")
    @ApiModelProperty("http请求协议 是否开启http调试模式")
    private boolean isEnableHttpTest;

    public String getPrefixUrl(){
        if(!isEnableHttpTest){
            return "https://" + host + ":" + https;
        }else{
            return "http://" + host + ":" + http;
        }
    }
}
